<template>
  <div class="find">
    <div class="headerw">
      <div class="left">
        <img src="../assets/img/fanhui.png" alt="" />
      </div>
      <div class="title">
        <p>发现好玩的</p>
      </div>
      <div class="right">
        <div class="img">
          <img src="../assets/img/shouye2.png" alt="" />
        </div>
      </div>
    </div>

    <div class="box">生活服务</div>

    <div class="mainz">
      <div class="items" v-for="(item, index) in imgs" :key="index">
        <div class="img">
          <img :src="item.img" alt="" />
        </div>
        <div class="word">
          <p>{{ item.name }}</p>
        </div>
      </div>
    </div>

    <div class="box" style="margin: 0px">热点推荐</div>

    <div class="bottom">
      <div class="item" v-for="(item, index) in imz" :key="index">
        <div class="img">
          <img :src="item.img" alt="" />
        </div>
        <div class="word">
          <p>{{ item.title }}</p>
          <span
            >{{ item.name }}
            <img src="../assets/img/fanhui2.png" alt="" />
          </span>
        </div>
      </div>
    </div>

    <div class="duo"></div>

    <div class="footer">
      <ul>
        <router-link tag="li" to="/home">
          <a>
            <div class="img">
              <img src="../assets/img/shouye.png" alt="" />
            </div>
            <div class="word">
              <p>首页</p>
            </div>
          </a>
        </router-link>
        <router-link tag="li" to="/talk">
          <a>
            <div class="img">
              <img src="../assets/img/taolun.png" alt="" />
            </div>
            <div class="word">
              <p>交流</p>
            </div>
          </a>
        </router-link>
        <router-link tag="li" to="/release">
          <a>
            <div class="img">
              <img src="../assets/img/fabulow.png" alt="" />
            </div>
            <div class="word">
              <p>发布</p>
            </div>
          </a>
        </router-link>
        <router-link tag="li" to="/find">
          <a>
            <div class="img">
              <img src="../assets/img/quan1.png" alt="" />
            </div>
            <div class="word">
              <p class="con">发现</p>
            </div>
          </a>
        </router-link>
        <router-link tag="li" to="/my">
          <a>
            <div class="img">
              <img src="../assets/img/wo.png" alt="" />
            </div>
            <div class="word">
              <p>我的</p>
            </div>
          </a>
        </router-link>
      </ul>
    </div>
  </div>
</template>

<script>
import { getimgs, getimz } from "../api/find";
export default {
  data() {
    return {
      imgs: null,
      imz: null,
    };
  },
  created() {
    getimgs().then((data) => {
      this.imgs = data.imgs;
    });
    getimz().then((data) => {
      this.imz = data.imz;
    });
  },
};
</script>

<style lang="scss" scoped>
.find {
  .headerw {
    display: flex;
    align-items: center;
    height: 48px;
    text-align: center;
    background: #53bcf5;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    .left {
      width: 20px;
      height: 20px;
      padding-left: 10px;
      img {
        width: 100%;
      }
    }
    .title {
      flex: 1;
      color: #fff;
    }
    .right {
      width: 10%;
      .img {
        width: 20px;
        height: 20px;
        img {
          width: 100%;
        }
      }
    }
  }
  .box {
    background: #f8f8f8;
    padding-bottom: 10px;
    padding-left: 16px;
    font-weight: normal;
    line-height: 42px;
    font-size: 16px;
    padding-top: 10px;
    margin-top: 48px;
  }
  .mainz {
    display: flex;
    flex-wrap: wrap;
    .items {
      box-sizing: border-box;
      width: 25%;
      display: flex;
      align-items: center;
      flex-direction: column;
      border-right: 1px solid #999;
      border-bottom: 1px solid #999;
      padding: 10px 0;
      &:nth-child(4n) {
        border-right: none;
      }
      .img {
        width: 52px;
        height: 52px;
        img {
          width: 100%;
        }
      }
    }
  }
  .bottom {
    .item {
      width: 100%;
      display: flex;
      height: 58px;
      justify-content: flex-start;
      align-items: center;
      border-bottom: 1px solid #efefef;
      .img {
        padding: 10px;
        width: 38px;
        height: 38px;
        img {
          width: 100%;
        }
      }
      .word {
        display: flex;
        align-items: center;
        flex: 1;
        justify-content: space-between;
        p {
          font-size: 16px;
        }
        span {
          font-size: 14px;
          color: #999;
          margin-right: 10px;
          img {
            width: 12px;
            height: 12px;
            background-size: 100%;
          }
        }
      }
    }
  }
  .duo {
    height: 60px;
  }
  .footer {
    background: #fff;
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    ul {
      display: flex;
      height: 40px;
      li {
        flex: 1;
        a {
          display: flex;
          flex-direction: column;
          align-items: center;
          .img {
            width: 24px;
            height: 24px;
            img {
              width: 100%;
            }
            &.con {
              transform: rotateX(180deg);
            }
          }
          .word {
            p {
              color: #999;
              font-size: 12px;
              &.con {
                color: #45dfe7;
              }
            }
          }
          .imgz {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: #53bcf5;
            margin-top: -26px;
            img {
              width: 24px;
              height: 24px;
              position: absolute;
              left: 0;
              top: -14px;
              right: 0;
              bottom: 0;
              margin: 0 auto;
            }
          }
        }
      }
    }
  }
}
</style>
